<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>交换两个数</title>
</head>
<body>
    <script>
        let a = 5;
        let b = 8;
        [a,b] = [b,a]

            // [a,b]
        console.log('%c   [a,b]: ','color: MidnightBlue; background: Aquamarine; font-size: 20px;', [a,b]);
            // 输出
            // (2) [8, 5]

    </script>
</body>
</html>